package models

import (
	"fmt"
	"github.com/go-redis/redis/v7"
	"store/conf"
)

var Rds *redis.Client

func RedisConfig() {
	var Cons = conf.Con.RedisConfig
	Rds = redis.NewClient(&redis.Options{
		Addr:     Cons.Addr,
		Password: Cons.Password,
		DB:       Cons.Db,
	})
	err = Rds.Ping().Err()
	if err != nil {
		fmt.Println("redis连接失败")
		return
	}
	fmt.Println("redis连接成功")
}
